<font face="MS Serif, New York, serif"><font face="0Font"></font></font><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
		function login(){
			var uname=document.getElementById("username").value;
			var pwd=document.getElementById("password").value;
			if(""==uname){
					document.getElementById("resultUsername").innerHTML="请输入用户名";
					return false;
				}
			if(""==pwd){
					document.getElementById("resultPassword").innerHTML="请输入密码";
					return false;
				}
			if("admin"=uname&&"1234"=pwd){
					document.getElementById("loginForm").action="main/main.html";
					document.getElementById("loginForm").submit();
					return true;
				}else{
					alert("对不起，用户名或密码错误");
					return false;
					}
			}

</script>
</head>

<body>
	<form id="loginForm" action="" method="post">
    	<table style="margin-top:180px" border="1" width="50%" align="center">
        	<tr>
            	<th align="right">用户名：</th>
            	<td>
                	<input id="username" type="text" name="username" />
                </td>
                <td id="resultUsername" width="30%"></td>
            </tr>
            	<tr>
                	<th align="right">密码：</th>
                    <td>
                    	<input id="password" type="text" name="password" />
                    </td>
                    <td id="resultPassword"></td>
                </tr>
                	<tr>
                    	<td colspan="3" align="center">
                        	<input type="button" value="登录" onClick="login();" />
                        
                        </td>
                    </tr>
        
        
        </table>
    
    </form>
</body>
</html>
